import request from '@/utils/request'


export default {

    //添加报名信息
    saveinfo(data) {
    return request({
      url: '/user/examineinfo/saveinfo',
      method: 'post',
      data
    })
  },

    //获取名字并校验
    getname(email) {
        return request({
          url: `/user/examineinfo/getname/${email}`,
          method: 'get'
        })
      },
      //获取考试次数并校验
      getnumber(email) {
        return request({
          url: `/user/examineinfo/getnumber/${email}`,
          method: 'put',
        })
      },

      //考核成绩
      saveresult(textarea,email) {
        console.log(textarea)
        return request({
          url: `/user/examineinfo/saveresult/${textarea}/${email}`,
          method: 'post'
        })
      },

      //获取考生成绩
      getinfo(email) {
        console.log(email)
        return request({
          url: `/user/examineinfo/getbyinfo/${email}`,
          method: 'post',
        })
      },

      //考生列表
      pageList(page, limit, searchObj) {
        return request({
            url: `/user/examineinfo/list/${page}/${limit}`,
            method: `post`,
            data: searchObj
        })
      },

       //根据id删除考生信息
      removeById(id) {
        return request({
            url: `/user/examineinfo/deleteId/${id}`,
            method: `delete`
        })
      },
      //批量删除考生信息
      Batchdeleter(idList) {
        return request({
            url: `/user/examineinfo/Batch_delete`,
            method: `delete`,
            data: idList
        })
    },

    //根据id获取考生信息
    getidbyinfo(id) {
      return request({
          url: `/user/examineinfo/getidbyinfo/${id}`,
          method: `put`,
      })
  },
     //根据email获取考生信息
     getcandidate(email) {
      return request({
          url: `/user/examineinfo/getcandidate/${email}`,
          method: `put`,
      })
  },
  //根据id修改考生信息
  updatecandidate(data) {
    return request({
        url: `/user/examineinfo/updatecandidate`,
        method: `post`,
        data
    })
},

    //绘图根据分数看人数
    getquantity() {
      return request({
          url: `/user/examineinfo/getquantity`,
          method: `get`,
      })
    },
    //查看平均分等绘图
    getavg() {
      return request({
          url: `/user/examineinfo/getavg`,
          method: `get`,
      })
    },



        //获取可以被打分的用户
        getnames(page, limit,email) {
          return request({
              url: `/user/examineinfo/getnames/${page}/${limit}/${email}`,
              method: `get`,
          })
        },

}